package fachada;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.DriverManager;

public class JDBC {
	
	private static Connection conexao;
	
	//Parametros da conexao
	private static String url = "jdbc:postgresql://localhost/projeto";
	private static String driver = "org.postgresql.Driver";
	private static String usuario = "postgres";
	private static String senha = "admin";
	
	//cria a conexao
	public static Statement getsStatement() throws ClassNotFoundException, SQLException {
		Class.forName(driver);
		conexao = DriverManager.getConnection(url,usuario,senha);
		
		return conexao.createStatement();
	}
	
	//fecha a conexao
	public static void fecharConexao() throws SQLException {
		conexao.close();
	}

}
